rm(list = ls())
knitr::opts_chunk$set(echo = TRUE,
message = FALSE,
warning = FALSE,
fig.align = 'center',
dev = 'jpeg',
dpi = 300,
fig.align='center')
#XQuartz is a mess, put this in your onload to default to cairo instead
options(bitmapType = "cairo")
# (https://github.com/tidyverse/ggplot2/issues/2655)
# Lo mapas se hacen mas rapido
library(tidyverse)
library(ggridges)
library(readxl)
library(here)
library(lubridate)
library(readr)
library(ggthemes)
library(hrbrthemes)
library(viridis)
library(kableExtra)
The following document and code intends to carry out a complementary methodological Exploratory Data Analysis from survey data in coquina (Donux truculus) in a historic context review of FEMP_AND_04 project.
In this case, we analysed biological component like lengths structure, density indicator and fishery yield in CPUE type.
This analysis are essential to give advice to Junta de Andaluacía through management plan to D. trunculus (Agricultura & Rural, 2023).
La zona de distribución de la coquina objeto de este análisis es en base a la aplicación de la regulación marisquera española, relacionado con la producción. Para ello, el litoral andaluz se dividió en diferentes zonas de producción (ZZPP) las cuales se encuentran definidas en la Orden de 15 de julio de 1993 (BOJA nº 85 de 5/8/1993).
En esta Orden se declaran las zonas de producción y protección o mejora de moluscos bivalvos, moluscos gasterópodos, tunicados y equinodermos marinos de la Comunidad Autónoma de Andalucía, fuera de las cuales quedará prohibida la su recolección. Esta norma delimita zonas de producción de moluscos bivalvos a lo largo del litoral andaluz en los cuales se encuentran los puntos de muestreo establecidos en el seguimiento temporal de D. trunculus en el litoral de Huelva llevado a cabo por el IEO (Marco & Delgado, 2022) (Figura 2.1).
Figure 2.1: Mapa con los puntos de muestreo establecidos en el seguimiento temporal de D. trunculus en el litoral de Huelva llevado a cabo por el IEO.
These data, spetially length frecuencies, must be weighted to the
sampling estimates, because they are just a subsample. This approach has
a logic used to POBLACIONAL (Figura 3.1) and
COMERCIAL samples (Figura 3.2);
Figure 3.1: Poblacional sample scheme
Figure 3.2: Comercial sample scheme
En este codigo autocontenido, analizaremos tres componentes de interés. Estructuras de tallas, densidades poblacionales e Indice de reclutamiento.
En este trabajo se deben revisar todos los componentes que se tienen en cuenta, para ello, investigadores del IEO prepararon una descripción de cada fuente , caracteristicas y su escala temporal. La mayoría de estos dsatos son compuestos por el monitoreo y seguimiento científico de Donax trunculus en el Golfo de Cádiz lque lleva a cabo el IEO y AGAPA.
| Item | Periodo | Observación | Agregación |
|---|---|---|---|
| DESEMBARQUE | 2020-2022 | kg/mariscador o barco/mes | Por playa |
| ESTRUCTURA TALLAS | 2017-2023 | Datos previos al 2020 deben ser revisados | Por playa, por tipo de rastro |
| vB Linf | 46 mm | Revisar | |
| M | M=2k | Revisar | |
| vB k | 0.48 | Revisar | |
| EDAD MÁXIMA | EM= log(0.01)/M | Revisar | |
| Parámetros gravimetricos | a;b | Revisar | |
| DENSIDAD | 2017-2023 | g/m2/ | Mes, Playa, Rastro |
| RENDIMIENTO (CPUE) | 2018-2023 | 3 horas/mariscador/dia. (180minpeso coquina>25mm5min) | Por Mes, playa, rastro |
| INDICE RECLUTAMIENTO (D15) | 2017-2022 | ind/m2 < 15mm | Por Mes, playa, rastro |
| TALLA PRIMERA MADUREZ | L50=10.8mm | L95= pendiente |
En cuanto a aspectos reproductivos, la reproducción de coquina es entre los meses de Febrero – julio, con un maximo de desove entre mayo- julio, coincidiendo con la veda (Agricultura & Rural, 2023).
# Datos 2020 size and dens and abundance join
size2017 <- read.csv2(here("Data", "Anterior a 2020", "data_ieo_2017_def.csv"), dec=".")
size2018 <- read.csv2(here("Data", "Anterior a 2020", "data_ieo_2018_def.csv"), dec=".")
size2019 <- read.csv2(here("Data", "Anterior a 2020", "data_ieo_2019_def.csv"), dec=".")
size2020 <- read.csv2(here("Data", "Anterior a 2020", "data_ieo_2020_def.csv"), dec=".")
# datos post 2020 separate files sizes and dens
# Lenght
size2021 <- read_excel(here("Data", "Posterior 2020", "Data_size_Coquina_2021.xlsx"),
sheet = "Coquina_donax")
size2022 <- read_excel(here("Data", "Posterior 2020", "Data_size_Coquina_2022.xlsx"),
sheet = "Coquina_donax")
size2023 <- read_excel(here("Data", "Posterior 2020", "Data_size_Coquina_2023.xlsx"),
sheet = "Coquina_Donax")
Se deben leer las dos hojas POBLACIONAL y COMERCIAL por separado y
luego unir.
Recordar wque las bases de densidades previas al 2020 estan en la misma base que las longitudes
dens2021pob <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2021.xlsx"),
sheet = "Data_POBL")
dens2021com <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2021.xlsx"),
sheet = "DATA_COM")
dens2022pob <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2022.xlsx"),
sheet = "Data_POBL")
dens2022com <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2022.xlsx"),
sheet = "DATA_COM")
dens2023pob <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2023.xlsx"),
sheet = "Data_POBL")
dens2023com <- read_excel(here("Data", "Posterior 2020",
"Data_sample_FEMP_04_2023.xlsx"),
sheet = "DATA_COM")
Este aspecto se trabaja de forma de ponderación ad-hoc descrita en la Figure 3.1
dim(size2017)
## [1] 10121 28
dim(size2018)
## [1] 20418 28
dim(size2019)
## [1] 18109 28
dim(size2020)
## [1] 13435 28
dim(size2021)
## [1] 21971 12
names(size2017)
## [1] "months" "Date"
## [3] "Beach" "Sampling.point"
## [5] "track_activelog" "lat_1"
## [7] "long_1" "lat_2"
## [9] "long_2" "plus_m"
## [11] "tow_time" "rastro"
## [13] "zaranda" "mariscador"
## [15] "sample" "Sample_weight"
## [17] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [19] "CAT" "Categoria"
## [21] "Size" "SizeE"
## [23] "Tide_coef" "Low_tide_hour"
## [25] "Sampling_hour" "number_fisherman"
## [27] "veda" "dists"
names(size2018)
## [1] "months" "Date"
## [3] "Beach" "Sampling.point"
## [5] "track_activelog" "lat_1"
## [7] "long_1" "lat_2"
## [9] "long_2" "plus_m"
## [11] "tow_time" "rastro"
## [13] "zaranda" "mariscador"
## [15] "sample" "Sample_weight"
## [17] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [19] "CAT" "Categoria"
## [21] "Size" "SizeE"
## [23] "Tide_coef" "Low_tide_hour"
## [25] "Sampling_hour" "number_fisherman"
## [27] "veda" "dists"
names(size2019)
## [1] "months" "Date"
## [3] "Beach" "Sampling.point"
## [5] "track_activelog" "lat_1"
## [7] "long_1" "lat_2"
## [9] "long_2" "plus_m"
## [11] "tow_time" "rastro"
## [13] "zaranda" "mariscador"
## [15] "sample" "Sample_weight"
## [17] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [19] "CAT" "Categoria"
## [21] "Size" "SizeE"
## [23] "Tide_coef" "Low_tide_hour"
## [25] "Sampling_hour" "number_fisherman"
## [27] "veda" "dists"
names(size2020)
## [1] "months" "Date"
## [3] "Beach" "Sampling.point"
## [5] "track_activelog" "lat_1"
## [7] "long_1" "lat_2"
## [9] "long_2" "plus_m"
## [11] "tow_time" "rastro"
## [13] "zaranda" "mariscador"
## [15] "sample" "Sample_weight"
## [17] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [19] "CAT" "Categoria"
## [21] "Size" "SizeE"
## [23] "Tide_coef" "Low_tide_hour"
## [25] "Sampling_hour" "number_fisherman"
## [27] "veda" "dists"
names(size2021)
## [1] "species" "Date" "Beach"
## [4] "Sampling.point" "rastro" "CAT"
## [7] "Categoria" "size" "sizeE"
## [10] "ID" "ID_codificado_punto" "ID_codificado_muestreo"
Same names. Could merge the DF
size_17_20 <- rbind(size2017,
size2018,
size2019,
size2020)
# new dimension
dim(size_17_20)
## [1] 62083 28
names(size_17_20)
## [1] "months" "Date"
## [3] "Beach" "Sampling.point"
## [5] "track_activelog" "lat_1"
## [7] "long_1" "lat_2"
## [9] "long_2" "plus_m"
## [11] "tow_time" "rastro"
## [13] "zaranda" "mariscador"
## [15] "sample" "Sample_weight"
## [17] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [19] "CAT" "Categoria"
## [21] "Size" "SizeE"
## [23] "Tide_coef" "Low_tide_hour"
## [25] "Sampling_hour" "number_fisherman"
## [27] "veda" "dists"
glimpse(size_17_20)
## Rows: 62,083
## Columns: 28
## $ months <int> 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, …
## $ Date <chr> "13/07/2017", "13/07/2017", "13/07/2017", …
## $ Beach <chr> "Donana", "Donana", "Donana", "Donana", "D…
## $ Sampling.point <chr> "2", "2", "2", "2", "2", "2", "2", "2", "2…
## $ track_activelog <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ lat_1 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ long_1 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ lat_2 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ long_2 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ plus_m <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ tow_time <dbl> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, …
## $ rastro <chr> "COMERCIAL", "COMERCIAL", "COMERCIAL", "CO…
## $ zaranda <chr> "R", "R", "R", "R", "R", "R", "R", "R", "R…
## $ mariscador <chr> "LUIS", "LUIS", "LUIS", "LUIS", "LUIS", "L…
## $ sample <chr> "13/07/2017", "13/07/2017", "13/07/2017", …
## $ Sample_weight <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ Clam_sample_weigth <dbl> 195, 195, 195, 195, 195, 195, 195, 195, 19…
## $ Measured_clam_sample_weigth <dbl> 195, 195, 195, 195, 195, 195, 195, 195, 19…
## $ CAT <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ Categoria <chr> "", "", "", "", "", "", "", "", "", "", ""…
## $ Size <dbl> 27.21, 26.65, 26.65, 25.07, 27.49, 26.15, …
## $ SizeE <int> 27, 26, 26, 25, 27, 26, 26, 28, 25, 28, 26…
## $ Tide_coef <int> 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72…
## $ Low_tide_hour <chr> "12:30 AM", "12:30 AM", "12:30 AM", "12:30…
## $ Sampling_hour <chr> "", "", "", "", "", "", "", "", "", "", ""…
## $ number_fisherman <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ veda <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ dists <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
Date columns from characterto Date formatsize_17_20$Date <- dmy(size_17_20$Date)
# separo los meses , dias y años
# Separar en columnas de día, mes y año
realdate <- as.Date(size_17_20$Date, format="%Y-%M-%D")
dfdate <- data.frame(Date=realdate)
ANO=as.numeric (format(realdate,"%Y"))
MES=as.numeric (format(realdate,"%m"))
DIA=as.numeric (format(realdate,"%d"))
size2<-cbind(dfdate,ANO,MES,DIA,size_17_20)
colnames(size2)
## [1] "Date" "ANO"
## [3] "MES" "DIA"
## [5] "months" "Date"
## [7] "Beach" "Sampling.point"
## [9] "track_activelog" "lat_1"
## [11] "long_1" "lat_2"
## [13] "long_2" "plus_m"
## [15] "tow_time" "rastro"
## [17] "zaranda" "mariscador"
## [19] "sample" "Sample_weight"
## [21] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [23] "CAT" "Categoria"
## [25] "Size" "SizeE"
## [27] "Tide_coef" "Low_tide_hour"
## [29] "Sampling_hour" "number_fisherman"
## [31] "veda" "dists"
table(size2$ANO)
##
## 2017 2018 2019 2020
## 10121 20418 18109 13435
Now we test.
table(size2$ANO)
##
## 2017 2018 2019 2020
## 10121 20418 18109 13435
Primera vizulación de las tallas de coquina diferenciasdas por tipo de muestreo. Línea roja es SL50 (10.8 mm para hembras (Delgado et al., 2017) y línea amarilla es la talla mínima de extracción legal en 25 mm. (Delgado & Silva, 2018).
nreg <- ggplot(size2 %>%
select(-1),
aes(x=Size,
y = as.factor(MES),
fill= as.factor(rastro)))+
geom_density_ridges(stat = "binline",
bins = 40,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=4) +
geom_vline(xintercept = 10.8, color = "red")+
geom_vline(xintercept = 25, color = "yellow")+
scale_fill_manual(values = c("#636363", "#2c7fb8", "#de2d26", "#756bb1", "#2ca25f"),
name="Rastro")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
nreg
by beach
nbeach <- ggplot(size2 %>%
select(-1),
aes(x=SizeE,
y = as.factor(MES),
fill= as.factor(Beach)))+
geom_density_ridges(stat = "binline",
bins = 40,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=4) +
geom_vline(xintercept = 10.8, color = "red")+
scale_fill_viridis_d(option="F",
name="Beach")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
nbeach
Now, we handling data 2021-2023. Same columns data 2017-2020
size2021b <- size2021 %>%
select(2, 3, 4, 5, 6, 7, 8, 9, 12)
names(size2021b)
## [1] "Date" "Beach" "Sampling.point"
## [4] "rastro" "CAT" "Categoria"
## [7] "size" "sizeE" "ID_codificado_muestreo"
size2022b <- size2022 %>%
select(-c(1, 2))
size2023b <- size2023 %>%
select(-c(1, 2))
size_21_23 <- rbind(size2021b,
size2022b,
size2023b)
Date column# separo los meses , dias y años
# Separar en columnas de día, mes y año
realdate2 <- as.Date(size_21_23$Date, format="%Y-%M-%D")
dfdate2 <- data.frame(Date=realdate2)
ANO=as.numeric (format(realdate2,"%Y"))
MES=as.numeric (format(realdate2,"%m"))
DIA=as.numeric (format(realdate2,"%d"))
size3<-cbind(dfdate2,ANO,MES,DIA,size_21_23)
colnames(size3)
## [1] "Date" "ANO" "MES"
## [4] "DIA" "Date" "Beach"
## [7] "Sampling.point" "rastro" "CAT"
## [10] "Categoria" "size" "sizeE"
## [13] "ID_codificado_muestreo"
table(size3$ANO)
##
## 2021 2022 2023
## 21971 17426 6751
Now join all years
names(size2) # 2017-2020
## [1] "Date" "ANO"
## [3] "MES" "DIA"
## [5] "months" "Date"
## [7] "Beach" "Sampling.point"
## [9] "track_activelog" "lat_1"
## [11] "long_1" "lat_2"
## [13] "long_2" "plus_m"
## [15] "tow_time" "rastro"
## [17] "zaranda" "mariscador"
## [19] "sample" "Sample_weight"
## [21] "Clam_sample_weigth" "Measured_clam_sample_weigth"
## [23] "CAT" "Categoria"
## [25] "Size" "SizeE"
## [27] "Tide_coef" "Low_tide_hour"
## [29] "Sampling_hour" "number_fisherman"
## [31] "veda" "dists"
names(size3)# 2021-2023
## [1] "Date" "ANO" "MES"
## [4] "DIA" "Date" "Beach"
## [7] "Sampling.point" "rastro" "CAT"
## [10] "Categoria" "size" "sizeE"
## [13] "ID_codificado_muestreo"
size2fil <- size2 %>%
select(1, 2, 3, 4, 7, 8, 16, 23, 24, 25, 26)
size3fil <- size3 %>%
select(-c(13,5)) %>%
rename(Size = size,
SizeE = sizeE)
names(size2fil) # 2017-2020
## [1] "Date" "ANO" "MES" "DIA"
## [5] "Beach" "Sampling.point" "rastro" "CAT"
## [9] "Categoria" "Size" "SizeE"
names(size3fil)# 2021-2023
## [1] "Date" "ANO" "MES" "DIA"
## [5] "Beach" "Sampling.point" "rastro" "CAT"
## [9] "Categoria" "Size" "SizeE"
# join data
sizeall <- rbind(size2fil, size3fil)
check
dim(sizeall)
## [1] 108231 11
table(sizeall$ANO)
##
## 2017 2018 2019 2020 2021 2022 2023
## 10121 20418 18109 13435 21971 17426 6751
Rename values
sizeall2 <- sizeall %>%
mutate(rastro = str_replace_all(rastro, " ", ""))
unique(sizeall2$rastro)
## [1] "COMERCIAL" "POBLACIONAL" "COMERCIALNEW"
some plots
nall <- ggplot(sizeall2,
aes(x=Size,
y = as.factor(MES),
fill= as.factor(rastro)))+
geom_density_ridges(stat = "binline",
bins = 50,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=7) +
geom_vline(xintercept = 10.8, color = "red")+
scale_fill_viridis_d(option="B",
name="Rastro")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
theme(legend.position = "bottom")+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
nall
La
nallbeach <- ggplot(sizeall2,
aes(x=Size,
y = as.factor(MES),
fill= as.factor(Beach)))+
geom_density_ridges(stat = "binline",
bins = 50,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=7) +
geom_vline(xintercept = 10.8, color = "red")+
scale_fill_viridis_d(option="F",
name="Beach")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
theme(legend.position = "bottom")+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
nallbeach
just POBLACIONAL sample
pobeach <- ggplot(sizeall2 %>%
filter(rastro!="COMERCIAL"),
aes(x=Size,
y = as.factor(MES),
fill= as.factor(Beach)))+
geom_density_ridges(stat = "binline",
bins = 50,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=7) +
geom_vline(xintercept = 10.8, color = "red")+
scale_fill_viridis_d(option="G",
name="Beach")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
theme(legend.position = "bottom")+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
pobeach
justm COMERCIAL sample
combeach <- ggplot(sizeall %>%
filter(rastro!="POBLACIONAL"),
aes(x=Size,
y = as.factor(MES),
fill= as.factor(Beach)))+
geom_density_ridges(stat = "binline",
bins = 50,
scale = 1.2,
alpha=0.7)+
facet_wrap(.~ANO, ncol=7) +
geom_vline(xintercept = 10.8, color = "red")+
scale_fill_viridis_d(option="F",
name="Beach")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
theme_few()+
theme(legend.position = "bottom")+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
combeach
last month of 2023 (august) by beach
combeachago23 <- ggplot(sizeall2 %>%
filter(ANO==2023),
aes(x=Size, fill=rastro))+
geom_histogram(bins = 80,
alpha=0.8)+
scale_fill_manual(values = c("red", "blue"))+
facet_grid(MES~Beach) +
geom_vline(xintercept = 10.8, color = "red")+
theme_few()+
theme(legend.position = "bottom")+
xlab("Longitud (cm.)")+
ylab("")+
xlim(0,40)+
labs(title= "Survey 2023")
#scale_x_discrete((limits = rev(levels(talla2021$ANO_ARR))))+
combeachago23
another way to viz is
scatter plot
sizemean <-sizeall2 %>%
dplyr::group_by(ANO, MES, rastro, Beach) %>%
dplyr::summarise(avg=mean(SizeE))
#kableExtra::kable(coutlength, format = "html")
Mean length in time series by Subarea.
pmea <- ggplot(sizemean,
aes(MES,avg,
color = factor(Beach)))+
geom_point(show.legend = T,
alpha=.7) +
geom_smooth(method= "lm",
colour='#253494')+
theme_few()+
facet_grid(rastro~ANO)+
scale_x_continuous(breaks = seq(from = 1, to = 12, by = 3))+
#scale_y_discrete(breaks = seq(from = 1, to = 13, by = 1))+
theme(axis.text.x = element_text(angle = 90))+
guides(fill = guide_legend(reverse=F))+
scale_color_viridis_d(option="H",
name="Beach")+
ylim(15,30)+
ylab("") +
xlab("") +
ggtitle("Lenght Mean Krill fishery")
pmea
Calculate a recruit index
inderec <- sizeall %>%
filter(rastro=="POBLACIONAL") %>%
drop_na(Size) %>%
dplyr::group_by(ANO, MES) %>%
dplyr::mutate(prolen = Size - 10) %>%
dplyr::mutate(prolen2 = prolen*-1 ) %>%
dplyr::summarize(prolen3 =mean(prolen2))
limite_superior <- round(mean(inderec$prolen3) +
1.96 * sd(inderec$prolen3) / sqrt(inderec$prolen3),3)
limite_inferior <- round(mean(inderec$prolen3) -
1.96 * sd(inderec$prolen3) / sqrt(inderec$prolen3),3)
inderec$colour <- ifelse(inderec$prolen3 < 0, "negative","positive")
indexplot <- ggplot(inderec,
aes(rev(MES),prolen3))+
geom_bar(stat="identity",
position="identity",
aes(fill = colour))+
scale_fill_manual(values=c(positive="firebrick1",
negative="black"),
name="")+
facet_wrap(.~ANO)+
theme_few()+
scale_x_continuous(breaks = seq(from = 1,
to = 12, by = 4))+
labs(y="IRK",
x="",
title = "Index Recruit Krill 48.1")+
coord_flip()
indexplot
Leo los datos entregados por E. Marco. Actualizar pedida con Junta Andalucia.
landings <- read_excel(here("Data",
"Datos_venta_2017_14_02_22.xlsx"))
Identifico las columnas necesarias para el analisis, que en este caso, serían las columnas condato crudo.
# Fecha original en formato "año-mes-día"
fecha_original <- ymd(landings$FECHA_VENTA)
# Separar en año, mes y día
ANO <- year(fecha_original)
MES <- month(fecha_original)
DIA <- day(fecha_original)
# uno la base
landings2 <-cbind(ANO,MES,DIA,landings)
Grafico general de los desembarques
landings3 <- landings2 %>%
group_by(ANO, MES, ESTABLECIMIENTO, ZONA_PRODUCCION) %>%
summarise(LANDINGS = sum(TOTAL_KILOS)/1000)
hist(landings3$LANDINGS)
quantile(landings3$LANDINGS)
## 0% 25% 50% 75% 100%
## 0.0010000 0.0500000 0.1908400 0.6449275 14.4210000
Hay valores cercanos a las 14 t. Identificar si esto tiene sentido. Preguntar a MD.
plotlam <- ggplot(landings3,aes(ANO, LANDINGS))+
geom_bar(stat = "identity")+
facet_wrap(.~ESTABLECIMIENTO)+
theme_few()
plotlam
Otra viz
landpop <- ggplot(landings3 %>%
group_by(ANO, ESTABLECIMIENTO) %>%
summarise(LANDINGS1 =sum(LANDINGS))) +
geom_segment( aes(x=ANO,
xend=ANO,
y=0,
yend=LANDINGS1), color="grey") +
geom_point( aes(x=ANO,
y=LANDINGS1,
colour=ESTABLECIMIENTO),
size=3) +
scale_colour_viridis_d(option="G")+
theme_few() +
theme(
legend.position = "none",
panel.border = element_blank(),
panel.spacing = unit(0.1, "lines"),
strip.text.x = element_text(size = 5),
axis.text.x = element_text(size = 5),
axis.text.y = element_text(size = 5)) +
xlab("") +
ylab("Desembarque por Establecimiento") +
facet_wrap(.~ESTABLECIMIENTO, ncol=8, scale="free_y")
landpop
Los datos fueron solicitados con información hasta Febrero del 2022, por lo mismo es necesario actualizar
orderland <- ggplot(landings3 %>%
group_by(ESTABLECIMIENTO) %>%
summarise(LANDINGS1 =sum(LANDINGS)) %>%
arrange(ESTABLECIMIENTO) %>%
mutate(ESTABLECIMIENTO=factor(ESTABLECIMIENTO,
ESTABLECIMIENTO)),
aes(x=ESTABLECIMIENTO,
y=LANDINGS1) ) +
geom_bar(stat="identity", fill="#69b3a2") +
coord_flip() +
theme_ipsum() +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position="none"
) +
xlab("") +
ylab("Desembarque total aculumado por Establecimiento")
orderland
kbl(table(landings2$MES, landings2$ANO))
| 2017 | 2018 | 2019 | 2020 | 2021 | 2022 |
|---|---|---|---|---|---|
| 106 | 323 | 269 | 427 | 475 | 463 |
| 66 | 284 | 302 | 160 | 524 | 225 |
| 111 | 256 | 327 | 382 | 611 | 0 |
| 72 | 369 | 340 | 221 | 516 | 0 |
| 9 | 6 | 69 | 64 | 0 | 0 |
| 44 | 31 | 299 | 189 | 202 | 0 |
| 140 | 245 | 472 | 618 | 665 | 0 |
| 117 | 150 | 301 | 556 | 606 | 0 |
| 76 | 261 | 144 | 469 | 486 | 0 |
| 88 | 332 | 330 | 458 | 474 | 0 |
| 211 | 244 | 226 | 455 | 458 | 0 |
| 191 | 190 | 292 | 508 | 459 | 0 |
CATsize and sizeEMES?